<DOCTYPE html>
<!--HTML5 doctype-->
<html>
	<head>
		<title>体征录入</title>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
	    <meta name="apple-mobile-web-app-capable" content="yes" />
	    <link rel="stylesheet" type="text/css" href="../../css/jquery.mobile-1.4.0.css" />
	    <link rel="stylesheet" type="text/css" href="../../css/zpdydhl_mobile.css">
	    <link rel="stylesheet" type="text/css" href="../../css/mobiscroll.custom-2.6.2.min.css">
	    <script type="text/javascript" src="../../js/jquery-1.8.3.min.js"></script>
	    <script type="text/javascript" src="../../js/zpdydhl_mobile.js"></script>
	    <script type="text/javascript" src="../../js/mobiscroll.custom-2.6.2.min.js"></script>
	</head>
	<body>
		<div class="ui-page ui-page-theme-c ui-page-header-fixed ui-page-active ttm_ui_page">
			
			<!-- <div data-role="content"> -->
			<form method="post" action="" name="tizheng_form">
				<div role="main" class="ui-content" style="padding:0;">
					<table width="100%" border="0" height="52">
						<tr>
							<td class="yizhu_baiyao_shaixuan_name" style="width:25%;">录入时间：</td>
							<td class="yizhu_baiyao_shaixuan_input">
								<input type="text" name="tizheng_input_time" id="tizheng_input_time" value="" data-role="none" style="text-align:center;">
							</td> 
							<td>
								<input type="button" value="历史" id="chakan_tizheng" class="search_button jiancha_search yizhu_search" data-role="none" style="margin-left:0px;"/>
							</td>
						</tr>
					</table>
					<table id="tizheng_list" border="0" cellspacing="0" cellpadding="0" class="tizheng_list">
						<tr>
							<th>类别</th>
							<th>方式</th>
							<th>检查值</th>
							<th>管理</th>
						</tr>
					</table>
					<div style=" height:1px;"></div>
				</div>
			</form>
			<!-- </div> -->
			

			<div id="tizhengluru_footer" style="background:#4b5c66;" class="ui-footer ui-footer-fixed slideup ui-bar-inherit">
				<div class="tizheng_class ui-content" style="padding:0 10px;">
					<ul>
						<li class="yiji">体温</li>
						<li class="yiji">脉搏</li>
						<li class="yiji">呼吸</li>
						<li class="yiji">血压</li>
						<li class="yiji">操作</li>
						<li class="yiji">血氧</li>
						<li class="yiji">出量</li>
						<li class="yiji">引流量</li>
						<li class="yiji">入量</li>
						<li class="yiji">大便次数</li>
						<li class="yiji">身高</li>
						<li class="yiji">体重</li>
						<li class="yiji">过敏药物</li>
						<li class="yiji">意识</li>
						<li class="yiji">瞳孔大小</li>
						<li class="yiji">心脏起搏器</li>
						<li class="yiji">说明</li>
					</ul>
				</div>
				<div class="tizheng_class2 ui-content" style="padding:0 10px;">
					<ul>

					</ul>
				</div>
				<div class="jianpan">
					<table class="jianpan_top" cellspacing="5" cellpadding="5" >
						<tr>
							<td>35.</td>
							<td>36.</td>
							<td>37.</td>
							<td>38.</td>
							<td>39.</td>
							<td>40.</td>
						</tr>
					</table>
					<table class="jianpan_main" cellspacing="5"  cellpadding="5">
						<tr>
							<td>1</td>
							<td>2</td>
							<td>3</td>
							<td id="del">
								<img src="../../css/images/delete.png" alt="" style="width:90%; height:50%;"/>
							</td>
							<td id="fuwei">复位</td>
						</tr>
					<tr>
						<td>4</td>
						<td>5</td>
						<td>6</td>
						<td>.</td>
						<td id="tizheng_add" rowspan="2">添加</td>
					</tr>
					<tr>
						<td>7</td>
						<td>8</td>
						<td>9</td>
						<td>0</td>
					</tr>
					</table>
				</div>
			</div>			
		</div>
		<script type='text/javascript'>
			$(function () {
				//setHeader()
				document_type_global = "tizhengLuru";

				//设置体征录入时间选择框，为其添加控件
				selectInputTime("tizheng_input_time",true);

				// 解决录入页面底部出现空白问题
				$(".dwb-e").die().live("mousedown",function(e){
					$("#tizhengluru_footer").css("position","fixed");
				});

				$('.shurukuang2').die().live('click',function(){
					$('.shurukuang').attr("class",'shurukuang2');
					$(this).attr('class','shurukuang');
				});

				$('.leibie_del').die().live('click',function(){
					$(this).parent().remove();
				});

				$("#fuwei").live('click',function(){
					if($('.tizheng_list tr:last td:last').text()=='' && $('.tizheng_list tr:last td:first').text()!='')
					{
						$('.jianpan_top').html('<tr><td>35.</td><td>36.</td><td>37.</td><td>38.</td><td>39.</td><td>40.</td></tr>');
						$('.tizheng_list tr:last').remove();
						$('.tizheng_class ul').html("<li>体温</li><li>脉搏</li><li>呼吸</li><li>血压</li><li>操作</li><li>血氧</li><li>出量</li><li>引流量</li><li>入量</li><li>大便次数</li><li>身高</li><li>体重</li><li>过敏药物</li><li>意识</li><li>瞳孔大小</li><li>心脏起搏器</li><li>说明</li>");
					}
					else
					{
						$('.tizheng_class ul').html("<li>体温</li><li>脉搏</li><li>呼吸</li><li>血压</li><li>操作</li><li>血氧</li><li>出量</li><li>引流量</li><li>入量</li><li>大便次数</li><li>身高</li><li>体重</li><li>过敏药物</li><li>意识</li><li>瞳孔大小</li><li>心脏起搏器</li><li>说明</li>");
					}
					$('.tizheng_class2 ul').html("");
				});

				$(".tizheng_class ul li").die().live('click',function(){
					var myDate = new Date();
					myDate.getFullYear();
					myDate.getMonth();
					myDate.getDate();
					myDate.getHours();
					myDate.getMinutes();
					myDate.getSeconds();
					var nowdate = myDate.getFullYear()+'-'+(myDate.getMonth()+1)+'-'+myDate.getDate()+' '+myDate.getHours()+':'+myDate.getMinutes();
					var dataarr = new Array();
					var data = $(this).text();
					var li_class = $(this).attr("class");
					if(data == '体温')
					{
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="6"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="体温">体温</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="tiwen">腋温</li><li class="tiwen">口内</li><li class="tiwen">直肠</li><li class="tiwen">复查</li><li class="tiwen">降温30分钟后测量</li>');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> ℃</div></li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="腋温">腋温');
						$(".tiwen").unbind().bind('mousedown',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '脉搏'&&li_class != "maibo")
					{
						$('.jianpan_top').html('<tr><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="7"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="脉搏">脉搏</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="maibo">脉搏</li><li class="maibo_duanchu">短绌脉</li><li class="maibo_xinlv">心率</li>');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> 次/分钟</div></li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="脉搏">脉搏');
						
						$(".maibo_duanchu").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							$('.tizheng_class2 ul').html('<li class="input_data"><div style="height:26px;line-height:26px;float:left;" class="danwei"></div><div class="shurukuang" style="float:left"></div><div class="danwei"  style="float:left">/</div><div style="height:26px;line-height:26px;float:left;" class="danwei" style="float:left"></div><div class="shurukuang2" style="float:left"></div><div class="danwei" style="float:left"> 次</div></li>');
						});
						$(".maibo_xinlv").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> 次/分钟</div></li>');
						});
						$(".maibo").unbind().bind('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> 次/分钟</div></li>');
						});
					}
					else if(data == '呼吸')
					{
						$('.jianpan_top').html('<tr><td>20</td><td>22</td><td>24</td><td>26</td><td>30</td><td>40</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="8"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="呼吸">呼吸</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="huxi">自主呼吸</li><li class="huxiji">使用呼吸机</li>');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> 次/分钟</div></li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="自主呼吸">自主呼吸');
						$(".huxiji").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						});
						$(".huxi").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="自主呼吸">自主呼吸');
						});
						
					}
					else if(data == '血压')
					{
						$('.jianpan_top').html('<tr><td>80</td><td>90</td><td>100</td><td>110</td><td>120</td><td>130</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="9"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="血压">血压</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="xueya_shoushu">收缩压/舒张压</li><li class="xueya">单收缩压</li><li class="xueya">单舒张压</li>');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div>/<div class="shurukuang2"></div><div class="danwei"> mmHg</div></li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="收缩压/舒张压">收缩压/舒张压');
						$(".xueya").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> mmHg</div></li>');
						});
						$(".xueya_shoushu").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div>/<div class="shurukuang2"></div><div class="danwei"> mmHg</div></li>');
						});
					}
					else if(data == '操作')
					{
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="-1"><input name="tongji_item_name[]" type="hidden" value=""><input name="jiancha_type[]" type="hidden" value="操作">操作</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="caozuo">请假</li><li class="caozuo">返回</li>');
						$(".caozuo").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							$('.tizheng_list tr:last td:eq(2)').html($(this).text());
						})
					}
					else if(data == '血氧')
					{
						$('.jianpan_top').html('<tr><td>100</td><td>99</td><td>98</td><td>97</td><td>96</td><td>95</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="10"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="血氧">血氧</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="xueyang">常规</li>');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> %</div></li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="常规">常规');
						$(".xueyang").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '出量')
					{
						$('.jianpan_top').html('<tr><td>800</td><td>1000</td><td>1500</td><td>2000</td><td>2500</td><td>3000</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="11"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="出量">出量</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="chuliang">尿量</li><li class="chuliang">大便量</li><li class="chuliang">其它</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="尿量">尿量');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> ml</div></li>');
						$(".chuliang").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '引流量')
					{
						$('.jianpan_top').html('<tr><td>800</td><td>1000</td><td>1500</td><td>2000</td><td>2500</td><td>3000</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="11"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="引流量">引流量</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html(
						'<li class="chuliang">盆腔引流</li>'+
						'<li class="chuliang">腹腔引流</li>'+
						'<li class="chuliang">胃肠减压</li>'+
						'<li class="chuliang">胸腔引流</li>'+
						'<li class="chuliang">胸腔闭式引流</li>'+
						'<li class="chuliang">硬膜下引流</li>'+
						'<li class="chuliang">硬膜外引流</li>'+
						'<li class="chuliang">脑室引流</li>'+
						'<li class="chuliang">持续腰池引流</li>'+
						'<li class="chuliang">宫腔引流</li>'+
						'<li class="chuliang">T型管引流</li>'+
						'<li class="chuliang">颈部创腔引流</li>'+
						'<li class="chuliang">肛管引流</li>'+
						'<li class="chuliang">创腔引流</li>'+
						'<li class="chuliang">鼻胆管引流</li>'+
						'<li class="chuliang">温氏孔引流</li>'+
						'<li class="chuliang">胃空肠造瘘管引流</li>'+
						'<li class="chuliang">肝创面引流</li>'+
						'<li class="chuliang">肛管引流</li>'
						);
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="盆腔引流">盆腔引流');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> ml</div></li>');
						$(".chuliang").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '入量')
					{
						$('.jianpan_top').html('<tr><td>200</td><td>500</td><td>800</td><td>1000</td><td>1500</td><td>2000</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="12"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="入量">入量</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="ruliang">输液</li><li class="ruliang">口服</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="输液">输液');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> ml</div></li>');
						$(".ruliang").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '大便次数')
					{
						$('.jianpan_top').html('<tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="13"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="大便次数">大便次数</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="dabiancishu">自行排便</li><li class="dabiancishu">灌肠后排便</li><li class="dabiancishu">大便失禁</li><li class="dabiancishu">人工肛门</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="自行排便">自行排便');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> 次</div></li>');
						$(".dabiancishu").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '身高')
					{
						$('.jianpan_top').html('<tr><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="14"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="身高">身高</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="shengao">常规</li><li class="shengao">卧床</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="常规">常规');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> cm</div></li>');
						$(".shengao").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '体重')
					{	
						$('.jianpan_top').html('<tr><td>4</td><td>5</td><td>6</td><7></td><td>8</td><td>9</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="15"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="体重">体重</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="tizhong_changgui">常规</li><li class="tizhong_wochuang">卧床</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="常规">常规');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei"> kg</div></li>');
						$(".tizhong_changgui").live('click',function(){
							$('.shurukuang').html();
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						});
						$(".tizhong_wochuang").live('click',function(){
							$('.shurukuang').html();
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						});
					}
					else if(data == '过敏药物')
					{
						$('.jianpan_top').html('<tr><td>青霉素</td><td>磺胺类</td><td>头孢类</td><td>阿司匹林</td><td>茶碱类</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="16"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="过敏药物">过敏药物</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="guominyaowu">阳性</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="阳性">阳性');
						$('.tizheng_class2 ul').html('<li class="input_data" style="width:50%;"><div class="shurukuang" contenteditable="true" style="width:100%;"></div></li>');
						$(".guominyaowu").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '意识')
					{
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="17"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="意识">意识</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="yishi">清醒</li><li class="yishi">模糊</li><li class="yishi">谵妄</li><li class="yishi">嗜睡</li><li class="yishi">昏睡</li><li class="yishi">潜昏迷</li><li class="yishi">中昏迷</li><li class="yishi">深昏迷</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="清醒">清醒');
						$('.tizheng_list tr:last td:eq(2)').html('清醒');
						$(".yishi").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							$('.tizheng_list tr:last td:eq(2)').html($(this).text());
						})
					}
					else if(data == '瞳孔大小')
					{
						$('.jianpan_top').html('<tr><td>1.</td><td>2.</td><td>3.</td><td>4.</td><td>5.</td><td>6.</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="18"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="瞳孔大小">瞳孔大小</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="tongkongdaxiao">常规</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="常规">常规');
						$('.tizheng_class2 ul').html('<li class="input_data">左<div class="shurukuang"></div>/右<div class="shurukuang2"></div><div class="danwei"> mm</div></li>');
						$(".tongkongdaxiao").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
						})
					}
					else if(data == '心脏起搏器')
					{
						$('.jianpan_top').html('<tr><td>是</td><td>否</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="19"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="心脏起搏器">心脏起搏器</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="tongkongdaxiao">是否使用</li><li class="tongkongdaxiao">次数</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="">');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div></li>');
						$(".tongkongdaxiao").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							if($(this).html()=="是否使用")
							{
								$('.jianpan_top').html('<tr><td>是</td><td>否</td></tr>');
								$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div></li>');
							}
							else if($(this).html()=="次数")
							{
								$('.jianpan_top').html('<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>');
								$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div><div class="danwei">次</div></li>');
							}
						})
					}
					else if(data == '说明')
					{
						$('.jianpan_top').html('<tr><td>有</td><td>无</td></tr>');
						$('.tizheng_list').append('<tr><td><input name="jiancha_type_id[]" type="hidden" value="19"><input name="tongji_item_name[]" type="hidden" value="体征"><input name="jiancha_type[]" type="hidden" value="说明">说明</td><td></td><td></td><td class="leibie_del"></td></tr>');
						$('.tizheng_class ul').html('<li class="tongkongdaxiao">特殊情况说明</li><li class="tongkongdaxiao">时间说明</li><li class="tongkongdaxiao">时间</li><li class="tongkongdaxiao">疼痛强度</li>');
						$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="特殊情况说明">特殊情况说明');
						$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div></li>');
						$(".tongkongdaxiao").live('click',function(){
							$('.tizheng_list tr:last td:eq(1)').html('<input name="jiancha_fangshi[]" type="hidden" value="'+$(this).text()+'">' + $(this).text());
							if($(this).html()=="特殊情况说明")
							{
								$('.jianpan_top').html('<tr><td>有</td><td>无</td></tr>');
								$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div></li>');
							}
							else if($(this).html()=="时间说明")
							{
								$('.jianpan_top').html('<tr><td>01-</td><td>02-</td><td>03-</td><td>04-</td><td>05-</td><td>06-</td><td>07-</td><td>08-</td><td>09-</td><td>10-</td><td>11-</td><td>12-</td></tr>');
								$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div></li>');
							}
							else if($(this).html()=="时间")
							{
								$('.jianpan_top').html('<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>');
								$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div></li>');
							}
							else if($(this).html()=="疼痛强度")
							{
								$('.jianpan_top').html('<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>');
								$('.tizheng_class2 ul').html('<li class="input_data"><div class="shurukuang"></div></li>');
							}
						})
					}
				});

				$("#tizheng_add").die().live('click',function(){
					var type_data = $('.tizheng_list tr:last td:eq(0)').text();
					var type_data_value = $('.shurukuang').text();
					if(type_data == '体温')
					{
						type_data_value = type_data_value.replace("..",".");
						$('.shurukuang').text(type_data_value);
						if (type_data_value<35 || type_data_value>43 || type_data_value=='')
							alert ('超出范围值');
						else
							tianjia();
					}
					else if(type_data == '脉搏')
					{
						if (type_data_value<0 || type_data_value>180 || type_data_value=='')
							alert ('超出范围值');
						else
							tianjia();
					}
					else if(type_data == '呼吸')
					{
						if($('.tizheng_list tr:last td:eq(2)').text() == '使用呼吸机')
							tianjia();
						else
						{
							if (type_data_value<0 || type_data_value>40 || type_data_value=='')
								alert ('超出范围值');
							else
								tianjia();
						}
						
					}
					else if(type_data == '血压')
					{
						if($('.tizheng_list tr:last td:eq(2)').text()=='收缩压/舒张压')
						{
							var type_data_value2 = $('.shurukuang2').text();
							if (type_data_value<0 || type_data_value>300 || type_data_value=='')
								alert ('超出范围值');
							else if (type_data_value2<0 || type_data_value2>300 || type_data_value2=='')
								alert ('超出范围值');
							else
								tianjia();
						}
						else
						{
							if (type_data_value<0 || type_data_value>300 || type_data_value=='')
								alert ('超出范围值');
							else
								tianjia();
						}
						
					}
					else if(type_data == '血氧')
					{
						if (type_data_value<80 || type_data_value>100 || type_data_value=='')
							alert ('超出范围值');
						else
							tianjia();
					}
					else if(type_data == '出量' || type_data == '入量')
					{
						if (type_data_value<1 || type_data_value>10000 || type_data_value=='')
							alert ('超出范围值');
						else
							tianjia();
					}
					else if(type_data == '大便次数')
					{
						if (type_data_value<0 || type_data_value>100 || type_data_value=='')
							alert ('超出范围值');
						else
							tianjia();
					}
					else if(type_data == '身高')
					{
						if (type_data_value<0 || type_data_value>280 || type_data_value=='')
							alert ('超出范围值');
						else
							tianjia();
					}
					else if(type_data == '体重')
					{
						if (type_data_value<0 || type_data_value>500 || type_data_value=='')
							alert ('超出范围值');
						else
							tianjia();
					}
					else if(type_data == '过敏药物')
					{
						if(type_data_value=='')
							alert ('值不能为空');
						else
							tianjia();
					}
					else if(type_data == '瞳孔大小')
					{
						var type_data_value2 = $('.shurukuang2').text();
						if (type_data_value<0 || type_data_value=='')
							alert ('超出范围值');
						else if (type_data_value2<0  || type_data_value2=='')
							alert ('超出范围值');
						else
							tianjia();
					}
					else
						tianjia();
				})
				$(".jianpan_top td").die().live('mousedown',function(){
					$(".shurukuang").html($(this).text());
				})

				$(".jianpan_main td").die().live('mousedown',function(){
					if($(this).attr("id")=='del')
					{
						var str = $(".shurukuang").html();
						$(".shurukuang").html(str.substring(0,str.length-1));
					}
					else
					{
						if(($(this).attr("id")!='tizheng_add') && ($(this).attr("id")!='tizheng_shangchuan') && ($(this).attr("id")!='fuwei'))
						{
							$(".shurukuang").append($(this).html());
						}
					}
				});

				$("#tizheng_shangchuan").die().live('click',function(){
					if(confirm("确认数据无误上传？"))
					{	
						$.ajax({
		                    type: "get",
		                    async: false,
		                    url:server_url+"Mobile/Tizheng/addTizhengJson/zhuyuan_id/"+patient_info_global.zhuyuan_id+"/patient_id/"+patient_info_global.patient_id+"/doctor_name/"+nurse_info_global.user_name+"/doctor_id/"+nurse_info_global.user_number+"/user_department/"+nurse_info_global.user_department+"/user_number/"+nurse_info_global.user_number+yiyuan_id,
		                    data:$('form[name="tizheng_form"]').serialize(),
		                    dataType: "jsonp",
		                    jsonp: "callbackAddTizhengJson",
		                    jsonpCallback:"feedBackStateAddTizhengJson",
		                    error:function(mes)
		                    {
		                        alert("请求失败，请稍后重试");
		                    },
		                    success: function(result) {
		                    	if(result.ret == "success"){
		                    		alert("上传成功");
		                    		$('#tizheng_list').html("<tr><th>类别</th><th>方式</th><th>检查值</th><th>管理</th></tr>");
		                    	}else{

		                    	}
		                    }
		                });
					}
				});

				$("#chakan_tizheng").die().live("click",function(){
					window.location.href = "http://"+host_ip+"/zpdydhl_mobile_v4/page/tizheng/showTizheng.html?page_before_tizhenglishi=tizhengLuru&host_ip="+host_ip+"&user_number="+nurse_info_global.user_number+"&user_name="+nurse_info_global.user_name+"&user_department="+nurse_info_global.user_department+"&patient_id="+patient_info_global.patient_id+"&patient_zhuyuan_id="+patient_info_global.zhuyuan_id+"&patient_zhuyuan_bingqu="+patient_info_global.zhuyuan_bingqu+"&patient_bingchuang_hao="+patient_info_global.bingchuang_hao+"&patient_xingming="+patient_info_global.xingming+"&patient_xingbie="+patient_info_global.xingbie+"&patient_nianling="+patient_info_global.nianling;
				});

			});

			//获取table中得数据，用个数组保存起来
			function getInfoFromTable(tableid){
				var tizheng_arr = new Array();
				$("#tizheng_list tr").each(function(index, e){
				});
			}

			function tianjia()
			{
				$('.jianpan_top').html('<tr><td>35.</td><td>36.</td><td>37.</td><td>38.</td><td>39.</td><td>40.</td></tr>');
				$('.tizheng_list tr:last td:eq(2)').append('<input name="jiancha_value[]" type="hidden" value="'+$('.input_data').text()+'">'+$('.input_data').text());
				$('.tizheng_list tr:last td:last').html('删除');
				$('.tizheng_class ul').html("<li>体温</li><li>脉搏</li><li>呼吸</li><li>血压</li><li>操作</li><li>血氧</li><li>出量</li><li>引流量</li><li>入量</li><li>大便次数</li><li>身高</li><li>体重</li><li>过敏药物</li><li>意识</li><li>瞳孔大小</li><li>心脏起搏器</li><li>说明</li>");
				$('.tizheng_class2 ul').html("");
			}
		</script>
	</body>
</html>